//
// CAnimatedMaterial.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CAnimatedMaterial extends IAnimatable {
  private long swigCPtr;

  public CAnimatedMaterial(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CAnimatedMaterial_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CAnimatedMaterial obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CAnimatedMaterial(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setMaterial(CMaterial pMat) {
    nel3dJNI.CAnimatedMaterial_setMaterial(swigCPtr, this, CMaterial.getCPtr(pMat), pMat);
  }

  public String getMaterialName() {
    return nel3dJNI.CAnimatedMaterial_getMaterialName(swigCPtr, this);
  }

  public void update() {
    nel3dJNI.CAnimatedMaterial_update(swigCPtr, this);
  }

  public static String getAmbientValueName() {
    return nel3dJNI.CAnimatedMaterial_getAmbientValueName();
  }

  public static String getDiffuseValueName() {
    return nel3dJNI.CAnimatedMaterial_getDiffuseValueName();
  }

  public static String getSpecularValueName() {
    return nel3dJNI.CAnimatedMaterial_getSpecularValueName();
  }

  public static String getShininessValueName() {
    return nel3dJNI.CAnimatedMaterial_getShininessValueName();
  }

  public static String getEmissiveValueName() {
    return nel3dJNI.CAnimatedMaterial_getEmissiveValueName();
  }

  public static String getOpacityValueName() {
    return nel3dJNI.CAnimatedMaterial_getOpacityValueName();
  }

  public static String getTextureValueName() {
    return nel3dJNI.CAnimatedMaterial_getTextureValueName();
  }

  public static String getTexMatUTransName(long stage) {
    return nel3dJNI.CAnimatedMaterial_getTexMatUTransName(stage);
  }

  public static String getTexMatVTransName(long stage) {
    return nel3dJNI.CAnimatedMaterial_getTexMatVTransName(stage);
  }

  public static String getTexMatUScaleName(long stage) {
    return nel3dJNI.CAnimatedMaterial_getTexMatUScaleName(stage);
  }

  public static String getTexMatVScaleName(long stage) {
    return nel3dJNI.CAnimatedMaterial_getTexMatVScaleName(stage);
  }

  public static String getTexMatWRotName(long stage) {
    return nel3dJNI.CAnimatedMaterial_getTexMatWRotName(stage);
  }

  public IAnimatedValue getValue(long valueId) {
    long cPtr = nel3dJNI.CAnimatedMaterial_getValue(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new IAnimatedValue(cPtr, false);
  }

  public String getValueName(long valueId) {
    return nel3dJNI.CAnimatedMaterial_getValueName(swigCPtr, this, valueId);
  }

  public ITrack getDefaultTrack(long valueId) {
    long cPtr = nel3dJNI.CAnimatedMaterial_getDefaultTrack(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public void registerToChannelMixer(CChannelMixer chanMixer, String prefix) {
    nel3dJNI.CAnimatedMaterial_registerToChannelMixer(swigCPtr, this, CChannelMixer.getCPtr(chanMixer), chanMixer, prefix);
  }

  public final static int NumTexAnimatedValues = nel3dJNI.CAnimatedMaterial_NumTexAnimatedValues_get();

  public final static class TAnimValues {
    public final static TAnimValues OwnerBit = new TAnimValues("OwnerBit", nel3dJNI.CAnimatedMaterial_OwnerBit_get());
    public final static TAnimValues AmbientValue = new TAnimValues("AmbientValue");
    public final static TAnimValues DiffuseValue = new TAnimValues("DiffuseValue");
    public final static TAnimValues SpecularValue = new TAnimValues("SpecularValue");
    public final static TAnimValues ShininessValue = new TAnimValues("ShininessValue");
    public final static TAnimValues EmissiveValue = new TAnimValues("EmissiveValue");
    public final static TAnimValues OpacityValue = new TAnimValues("OpacityValue");
    public final static TAnimValues TextureValue = new TAnimValues("TextureValue");
    public final static TAnimValues TextureMatValues = new TAnimValues("TextureMatValues");
    public final static TAnimValues AnimValueLast = new TAnimValues("AnimValueLast", nel3dJNI.CAnimatedMaterial_AnimValueLast_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TAnimValues swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TAnimValues.class + " with value " + swigValue);
    }

    private TAnimValues(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TAnimValues(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TAnimValues(String swigName, TAnimValues swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TAnimValues[] swigValues = { OwnerBit, AmbientValue, DiffuseValue, SpecularValue, ShininessValue, EmissiveValue, OpacityValue, TextureValue, TextureMatValues, AnimValueLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
